<template>
  <div class="about" @mouseleave="hide" @mouseenter="showDiv(show)">
    <ul>
      <li>全部商品分类</li>
      <li @mouseenter="showDiv(dianqi)">家用电器<span>></span></li>
      <li @mouseenter="showDiv(shuma)">手机 数码 相机<span>></span></li>
      <li @mouseenter="showDiv(diannao)">电脑 办公<span>></span></li>
      <li @mouseenter="showDiv(jiaju)">家具 家居 家装<span>></span></li>
      <li @mouseenter="showDiv(fuzhuang)">男装 女装 珠宝<span>></span></li>
      <li @mouseenter="showDiv(xiebao)">鞋靴 箱包 钟表<span>></span></li>
    </ul>
    <div v-show="isShow" class="nav-item">
      <a href="##" v-for="(item, index) in show" :key="index">{{ item }}</a>
    </div>
  </div>
</template>

<script>
export default {
  name: '',
  data() {
    return {
      show: [],
      dianqi: ['空调', '冰箱', '洗衣机', '干衣机', '热水器', '酒柜', '洗碗机'],
      shuma: [
        '手机通讯',
        '运营商',
        '手机配件',
        '摄影摄像',
        '数码配件',
        '影音娱乐',
        '智能设备',
        '电子教育'
      ],
      diannao: [
        '电脑整机',
        '电脑配件',
        '外设产品',
        '游戏设备',
        '网络产品',
        '办公设备',
        '文具',
        '耗材',
        '服务产品'
      ],
      jiaju: [
        '厨具',
        '家纺',
        '生活日用',
        '家装软饰',
        '灯具',
        '家具',
        '全屋定制',
        '建筑材料',
        '厨房卫浴',
        '五金电工',
        '装修设计'
      ],
      fuzhuang: ['女装', '男装', '内衣', '配饰', '童装', '童鞋'],
      xiebao: [
        '时尚女鞋',
        '潮流女包',
        '精品男包',
        '功能箱包',
        '奢侈品',
        '精选大牌',
        '钟表',
        '珠宝首饰',
        '金银投资'
      ],
      isShow: true
    }
  },
  methods: {
    showDiv(name) {
      this.isShow = true
      this.show = name
    },
    hide() {
      this.isShow = false
    }
  }
}
</script>

<style scoped lang="less">
.about {
  width: 100%;
  height: 400px;
  overflow: hidden;
  ul {
    width: 200px;
    padding: 0;
    margin: 0;
    float: left;
  }
  li {
    width: 100%;
    height: 50px;
    background-color: red;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #000;
    list-style: none;
    box-sizing: border-box;
  }
  .nav-item {
    width: 400px;
    height: 350px;
    border-left: 1px solid #000;
    background-color: red;
    float: left;
    a {
      float: left;
      margin: 0.1rem;
    }
  }
}
</style>
